package com.ruoyi.jjkc.fygz.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.jjkc.fygz.domain.FyGz;
import com.ruoyi.jjkc.fygz.service.IFygzService;
import com.ruoyi.jjkc.qyjbxx.domain.Qyjbxx;
import com.ruoyi.jjkc.qyjbxx.service.IQyjbxxService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;

/**
 * 费用跟踪Controller
 *
 * @author huacai
 * @date 2024-12-14
 */
@RestController
@RequestMapping("/jjkc/fygz")
public class FygzController extends BaseController {
    @Resource
    private IFygzService fygzService;

    /**
     * 查询费用跟踪列表
     */
    @GetMapping("/selectFygzList")
    public TableDataInfo selectFygzList(FyGz fyGz) {
        startPage();
        List<FyGz> list = fygzService.selectFygzList(fyGz);
        return getDataTable(list);
    }

    /**
     * 导出费用跟踪列表
     */
    @Log(title = "费用跟踪", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, FyGz fyGz) {
        List<FyGz> list = fygzService.selectFygzList(fyGz);
        ExcelUtil<FyGz> util = new ExcelUtil<FyGz>(FyGz.class);
        util.exportExcel(response, list, "费用跟踪数据");
    }


}
